<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登入</title>
    <link rel="stylesheet" type="text/css" href="css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="css/default.css">
    <script src='js/prefixfree.min.js'></script>
    <link rel="stylesheet" type="text/css" href="css/login.css">
    <link href="less/Black.ico" rel="shortcut icon" />
    <script src='js/jquery-2.0.3.js'></script>
    <script type="text/javascript" src="js/jquery.md5.js"></script>
    <!--提示框-->
    <link href="resourse/plugins/toast/jquery.toast.css" rel="stylesheet">
    <script src="resourse/plugins/toast/jquery.toast.js"></script>

</head>
<body>
<input type="hidden" name="path"     id="path"   value="<%=request.getContextPath()%>" />
<div id="logo">
    <h1 class="hogo"><i>打开世界的大门</i></h1>
</div>
<section class="stark-login">
    <form id="from"  >
        <div id="fade-box">
            <input type="text" name="username" id="username" placeholder="用户名" autocomplete="off" required>
            <input type="password" id="password" placeholder="密码" autocomplete="off" required>
            <button id="btn_submit" >登入</button>
        </div>
    </form>
    <div class="hexagons">
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>

        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
    </div>
</section>

<div id="circle1">
    <div id="inner-cirlce1">
        <h2> </h2>
    </div>
</div>
<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
</body>
</html>
<script>
    //登陆
    $("#from").on('submit',function(){
        //用户登陆
        $.post(
                $("#path").val()+"/login",
                {
                    date : (new Date()).getTime(),
                    username : $("#username").val(),
                    password : $.md5($("#password").val()) ,
                    //32x
                },
                function(data){
                    data=$.parseJSON(data);
                    if(data.data=="false"){
                        toastAlert("error","错误","用户账号或密码错误!");
                    }
                    else {
                        //window.location.href=$("#path").val()+'/jsp/test/test.jsp';
                        window.location.href=$("#path").val()+'/main.jsp';
                    }

                }
        )

        return false;

    });
    //  绑定  键盘 回车键==登入键
    $(document).keydown(function(event){
        if(event.keyCode == 13){  $("#btn_submit").click();  }
    });
    // 提示框事件
    function toastAlert(icon,heading,text){
        $.toast({
            heading: heading,
            text: text,
            stack: false,
            position: 'mid-center',
            showHideTransition: 'fade',
            icon: icon   // icon:error warning  success info
        })
    }
</script>